#include <stdio.h>
#include <string.h>

struct student
{
    char name[20];
    int age;
};




int main()
{
    struct student st1 = {"abc", 30};
    struct student st2;
    st2 = st1;//结构体变量的赋值,赋值就是  内存拷贝
//    memcpy(&st2, &st1, sizeof(st1));
    printf("st2.name = %s, st2.age = %d\n", st2.name, st2.age);

    struct student *p;
    p = &st1;
    //strcpy((*p).name, "hello");
    //(*p).age = 50;//加括号，是优先级问题
    strcpy(p->name, "hello");
    p->age = 50;
    printf("st1.name = %s, st1.age = %d\n", st1.name, st1.age);
    return 0;
}

